# coding:utf-8
__author__ = 'ila'

from datetime import datetime
from sqlalchemy import text, TIMESTAMP, ForeignKey
from api.models.models import Base_model
from api.exts import db

class diannaowaishe(Base_model):
    __doc__ = '电脑外设表'
    __tablename__ = 'diannaowaishe'
    __table_args__ = {'extend_existing': True} 
    
    id = db.Column(db.BigInteger, primary_key=True)
    waishemingcheng = db.Column(db.String(200), nullable=True, info='外设名称')
    waishefenlei = db.Column(db.String(200), nullable=True, info='外设分类')
    jiagequjian = db.Column(db.String(200), nullable=True, info='价格区间')
    pinpai = db.Column(db.String(200), nullable=True, info='品牌')
    jiage = db.Column(db.Float, nullable=True, info='价格')
    shengchanriqi = db.Column(db.Date, nullable=True, info='生产日期')
    shengchanshang = db.Column(db.String(200), nullable=True, info='生产商')
    shangshiriqi = db.Column(db.Date, nullable=True, info='上市日期')
    tupian = db.Column(db.Text, nullable=True, info='图片')
    waishejieshao = db.Column(db.Text, nullable=True, info='外设介绍')
    shangjia_id = db.Column(db.BigInteger, ForeignKey('shangjia.id'), nullable=True, info='商户ID')
    status = db.Column(db.Integer, default=0, nullable=True, info='审核状态(0:待审核,1:通过,2:驳回)')
    reason = db.Column(db.String(200), nullable=True, info='驳回原因')
    addtime = db.Column(db.DateTime, nullable=False, default=datetime.now, server_default=db.FetchedValue(), info='创建时间')